<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <input type="text" id="input">

    <script>
        //绑定事件
        let input = document.querySelector("#input");

        //绑定事件  当input的『值发生改变』的时候触发
        input.onchange = function(){
            console.log('值改变了')
        }

    </script>
</body>
</html>